# import lightgbm as lgb
from preprocess_0 import preprocess
import pandas as pd
import xgboost as xgb

train_data_path = r'datasets/train.csv'
test_data_path = r'datasets/test1.csv'
train_data,label,_ = preprocess(train_data_path)
test_data,_,test_sid = preprocess(test_data_path)



# model = xgb.XGBClassifier(
#             max_depth=6, learning_rate=0.05, n_estimators=2000,
#             objective='binary:logistic', tree_method='gpu_hist',
#             subsample=0.8, colsample_bytree=0.8,
#             min_child_samples=3, eval_metric='auc', reg_lambda=0.5
#         )
model = xgb.XGBClassifier(
            max_depth=6, learning_rate=0.05, n_estimators=3000,
            objective='binary:logistic', tree_method='gpu_hist',
            subsample=0.8, colsample_bytree=0.8,
            min_child_samples=3, eval_metric='auc', reg_lambda=0.5
        )
# 模型训练

model.fit(train_data.drop([ 'version','osv','lan'], axis=1), label)
result = model.predict(test_data.drop([ 'version','osv','lan'], axis=1))
print(result)
res = pd.DataFrame(test_sid)
res['label'] = result
res.to_csv('result/xgb_osv_screen_lan_1.csv',index=False)
print(res)